//用于测试的api
import request from '@/utils/httpRequest/request'

const api = {
    countryInfo: '/api/proxy?url=https://corona.lmao.ninja/v2/historical/', //单个国家历史数据
    countriesInfo: '/api/proxy?url=https://corona.lmao.ninja/v2/countries?yesterday&sort', //全部国家数据
    globalVaccine: '/api/proxy?url=https://cov19.cc/report.json', //全球疫苗数据
    globalData: '/api/proxy?url=https://corona.lmao.ninja/v2/all?yesterday', //全球数据
    provincesInfo: '/api/historicaldata/week', //全部省份数据

    dangercity:"/api/query/risk-area",
    china:"/api/chinaCity"
}
export const overview = {
    countryInfo: function(country) {
        return request({
            url: api.countryInfo + country + '?lastdays=1000',
            method: 'get',
        })
    },
    countriesInfo: function() {
        return request({
            url: api.countriesInfo,
            method: 'get',
        })
    },
    globalData: function() {
        return request({
            url: api.globalData,
            method: 'get',
        })
    },
    //这个接口现在也负责请求所有国家数据
    globalVaccine: function() {
        return request({
            url: api.globalVaccine,
            method: 'get',
        })
    },
    provincesInfo: function(n) {
        return request({
            url: api.provincesInfo + '?n=' + n,
            method: 'get',
        })
    },
    chinaTable: function () {
        return request({
            url: api.china,
            method: 'get',
        })
    },
    dangerCity: function() {
        return request({
            url: api.dangercity,
            method: 'get'
        })
    }
}

